import request from "@/utils/request";

// // 获取路由
// export const getRouters = () => {
//   return request({
//     url: "api/sysMenu/treeForGrant",
//     method: "get",
//   });
// };

//获得all菜单list
export const getAllMenus = (data) => {
  return request({
    url: "api/Menu/GetMenuList",
    method: "post",
    data,
    loading:false
  });
};

//获得all菜单button
export const getAllButtons = (data) => {
  return request({
    url: "api/Button/GetButtonList_Page",
    method: "post",
    data,
  });
};

//获得自己菜单list
export const getMenus = (data) => {
  return request({
    url: "api/User/GetCurrentUserRoleMenus",
    method: "post",
    data,
  });
};

//添加菜单
export const addMenus = (data) => {
  return request({
    url: "api/Menu/AddMenu",
    method: "post",
    data,
  });
};

//编辑菜单
export const editMenus = (data) => {
  return request({
    url: "api/Menu/EditMenu",
    method: "post",
    data,
  });
};

//删除菜单
export const deleteMenus = (data) => {
  return request({
    url: "api/Menu/DelMenu",
    method: "post",
    data,
  });
};

//添加按钮
export const addButtons = (data) => {
  return request({
    url: "api/Button/AddButton",
    method: "post",
    data,
  });
};

//编辑按钮
export const editButtons = (data) => {
  return request({
    url: "api/Button/EditButton",
    method: "post",
    data,
  });
};

//删除按钮
export const deleteButtons = (data) => {
  return request({
    url: "api/Button/DelButton",
    method: "post",
    data,
  });
};
